﻿using System;
using System.Collections.Generic;
using System.Text;
using DotNet.Data;
using System.Data;
namespace DotNet.Business
{
	public class Tab_RawMaterialBll
	{
		Tab_RawMaterialDal tDal=new Tab_RawMaterialDal();

		#region 是否存在该记录
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(int RawMaterialID)
		{
			return tDal.Exists(RawMaterialID);
		}
		#endregion

		#region 获得数据列表
		/// <summary>
		/// 获得数据列表
		/// </summary>
		public IList<Tab_RawMaterial> GetModel()
		{
			return tDal.GetModel();
		}
		#endregion

		#region 根据标识列获得数据实体
		/// <summary>
		/// 根据标识列获得数据实体
		/// </summary>
		/// <param name="RawMaterialID">标识列</param>
		/// <returns></returns>
		public Tab_RawMaterial GetModel(int RawMaterialID)
		{
			return tDal.GetModel(RawMaterialID);
		}
		#endregion

		#region 修改信息
		/// <summary>
		/// 修改信息
		/// </summary>
		/// <param name="Tab_RawMaterial">实体</param>
		/// <returns></returns>
		public bool Update(Tab_RawMaterial tab_rawmaterial)
		{
			 return tDal.Update(tab_rawmaterial);
		}
		#endregion

		#region 删除信息
		/// <summary>
		/// 删除信息
		/// </summary>
		/// <param name="RawMaterialID">标识列</param>
		/// <returns></returns>
		public bool Delete(int RawMaterialID)
		{
			 return tDal.Delete(RawMaterialID);
		}
		#endregion

		#region 添加信息
		/// <summary>
		/// 添加信息
		/// </summary>
		/// <param name="Tab_RawMaterial">实体</param>
		/// <returns></returns>
		public bool Insert(Tab_RawMaterial tab_rawmaterial)
		{
			 return tDal.Insert(tab_rawmaterial);
		}
		#endregion

        #region 材料分页
        /// <summary>
        /// 材料分页
        /// </summary>
        /// <param name="pageIndex">索引</param>
        /// <param name="pageSize">页数</param>
        /// <param name="rawMaterialsClassID">材料类别ID</param>
        /// <returns></returns>
        public DataTable pageForRawMaterial(int pageIndex,int pageSize,int rawMaterialsClassID)
        {
            if (rawMaterialsClassID == 0)
            {
                return tDal.pageForRawMaterial(pageIndex, pageSize);
            }
            else
            {
                return tDal.pageForRawMaterial(pageIndex, pageSize, rawMaterialsClassID);
            }
        }
        #endregion

        #region 获得材料数
        /// <summary>
        /// 获得材料数
        /// </summary>
        /// <param name="rawMaterialClassID">材料类别ID</param>
        /// <returns></returns>
        public int getRecordCount(int rawMaterialClassID)
        {
            if (rawMaterialClassID == 0)
            {
                return tDal.getRecordCount();
            }
            else
            {
                return tDal.getRecordCount(rawMaterialClassID);
            }
        }
        #endregion
    }
}
